<template>
	<view class="container">
		<view class="main">
			<image src="@/static/pic01.png" mode="aspectFill" class="top-img"></image>
			<view class="card">
				<view class="word1 weight800 title">
					<image
						v-if="info.status === 1"
						src="@/static/进行中.png"
						mode="aspectFit"
						class="status-img"
					></image>
					<image
						v-if="info.status === 2"
						src="@/static/已结束.png"
						mode="aspectFit"
						class="status-img"
					></image>
					{{ info.title }}
				</view>
				<view class="word5 tips">
					<view class="word4">{{ info.activityTime }}</view>
					<view>
						<image
							v-if="info.status === 1"
							src="@/static/chakan@2x.png"
							mode="aspectFit"
							class="icon-img"
						></image>
						<view style="color: #2c58ff">160次</view>
					</view>

					<view>
						<image
							v-if="info.status === 1"
							src="@/static/gerentouxiang_o@2x.png"
							mode="aspectFit"
							class="icon-img"
						></image>
						<view>
							<text>已报名</text>
							<text>
								<text style="color: #ff9901">{{ info.registrationCount }}</text>
								/ {{ info.totalCount }}人
							</text>
						</view>
					</view>
				</view>
			</view>
			<view class="card">
				<view class="word2">{{ info.location.city }} ｜ {{ info.location.addr }} ></view>
				<view class="drivir"></view>
				<view class="word5 mud1 location">
					<image
						v-if="info.status === 1"
						src="@/static/juli@2x.png"
						mode="aspectFit"
						style="width: 24px; height: 24px;margin-right: 10rpx;;"
					/>
					{{ info.location.addr }}
				</view>
			</view>
			<view class="card">
				<pre>
					{{ info.description }}
				</pre
				>
			</view>
		</view>
		<view class="footer">
			<view class="word1 weight800">
				<text style="color: #ff9901; font-size: 1.2em">{{ info.price }}</text>
				元
			</view>
			<view class="btn-group">
				<view class="btn">收藏活动</view>
				<view class="btn">立即报名</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue'
const info = ref({
	status: 1,
	registrationCount: 20,
	totalCount: 40,
	title: '京师幼学课间操户外绘画学习活动',
	activityTime: '2023/09/16 - 2023/09/23',
	location: {
		city: '邵阳市',
		addr: '京师幼学新舟幼儿园'
	},
	registrationTime: '2023/09/16 - 2023/09/23',
	price: 68,
	description:
		'一个会绘画的人，就仿佛有一技之长。不论是在学校，是在培训班,在集体的环境里，只要有绘画的机会,你会发现你有自己的优势。所以你会'
})
</script>

<style lang="less" scoped>
.container {
	width: 100vw;
	height: 100vh;
	font-weight: 500;
	color: #333333;
	display: grid;
	grid-template-rows: 1fr 140rpx;
	grid-template-columns: 1fr;

	.word1 {
		font-size: 36rpx;
	}

	.word2 {
		font-size: 32rpx;
	}

	.word3 {
		font-size: 28rpx;
		font-family: PingFang SC;
	}

	.word4 {
		font-size: 26rpx;
		color: #666666;
		line-height: 40rpx;
	}

	.word5 {
		font-size: 24rpx;
		color: #999999;
	}

	.weight800 {
		font-weight: 800;
	}

	.mud1 {
		margin: 0.5rem 0;
	}

	.drivir {
		width: 100%;
		height: 1px;
		background-color: #eeeff0;
		margin: 0.3rem 0;
	}

	.main {
		width: 100%;
		height: 100%;
		background: #f5f5f5;
		background: transparent;
		overflow-y: auto;

		.top-img {
			width: 100%;
			top: 0;
			z-index: 10;
		}

		.card {
			background: #ffffff;
			padding: 20rpx;
			box-sizing: border-box;
			margin-bottom: 10rpx;

			&:first-of-type {
				border-radius: 40rpx 40rpx 0rpx 0rpx;
				padding-top: 40rpx;
				margin-top: -50rpx;
				position: relative;
				z-index: 100;
			}
		}
		.title {
			display: flex;
			align-items: center;
			.status-img {
				width: 140rpx;
				height: 60rpx;
			}
		}
		.location {
			display: flex;
			align-items: center;
		}
		.tips {
			margin-top: 0.5rem;
			display: flex;
			justify-content: space-between;
			align-items: center;

			view {
				display: flex;
				align-items: center;
			}

			.icon-img {
				width: 32rpx;
				height: 32rpx;
			}
		}
	}
	.footer {
		padding-bottom: constant(safe-area-inset-bottom); /*兼容 IOS<11.2*/
		padding-bottom: env(safe-area-inset-bottom); /*兼容 IOS>11.2*/
		padding-top: 20rpx;
		padding-right: 20rpx;
		padding-left: 20rpx;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.btn-group {
			display: flex;
			color: #fff;
			font-size: 32rpx;
			font-weight: 800;

			.btn {
				padding: 20rpx 30rpx;

				&:nth-child(1) {
					border-radius: 50rpx 0 0 50rpx;
					background: linear-gradient(-90deg, #5283fc, #2b57ff);
				}
				&:nth-child(2) {
					border-radius: 0 50rpx 50rpx 0;
					background: linear-gradient(-90deg, #ff9901, #ffb554);
				}
			}
		}
	}
}
</style>
